
<style type="text/css">
.tab-pane.active{position:relative;margin:0 15px;}
.tab-pane.active .tabright{position:absolute;right:0;top:-43px;right:0;}
</style>
<link rel="stylesheet" type="text/css" href="/public/store/webuploader.css" />
<ol class="breadcrumb">
    <li class="active"><a href="#">商品管理</a></li>
</ol>
<!-- seat end -->
<div class="row">
    <!-- rightcont start -->
    <ul class="nav nav-tabs gn_tabs">
        <label style="float: left;margin-top: 3px" for="searchStr">搜索：&nbsp</label><input style="float: left;width: 80%" id="searchStr" placeholder="拼音首字母（拼音小写）" class="form-control">
        <a href="#searchGoodList" role="presentation" class="btn btn-default" style="color:black !important;margin-left: 10px" id="search_a">
            <span  class="glyphicon glyphicon-search"></span>搜索
        </a>
        <p></p>
        <li role="presentation" class="active"><a href="#goods">商品管理</a></li>
        <li role="presentation"><a href="#goodstype">管理分类</a></li>
        <li role="presentation"><a href="#jifen">积分商城</a></li>
<!--        <button id="test">test</button>-->
    </ul>
    <div class="tab-content">
        <div url="goodsList" role="tabpanel" class="tab-pane active" id="goods">
        </div>
        <div url="goodsTypeList" role="tabpanel" class="tab-pane" id="goodstype">
        </div>
        <div url="scoreGoodsList" role="tabpanel" class="tab-pane" id="jifen">
        </div>
        <div url="goodsList" role="tabpanel" class="tab-pane" data-goods-name-content="" id="searchGoodList"></div>
    </div>
    <!-- rightcont end -->
</div>

    <!--商品管理部分模板-->
<script type="text/html" id="goods_tmpl">
    <div class="tabright"><div class="btn gn_btn">新增商品</div></div>
    <table class="table table-bordered from_table">
        <tr>
            <th class="text-center" nowrap>状态</th>
            <th class="text-center" nowrap>分类</th>
            <th class="text-center" nowrap>名称</th>
            <th class="text-center" nowrap>图片</th>
            <th class="text-center" nowrap>售价</th>
            <th class="text-center" nowrap>会员价</th>
            <th class="text-center" nowrap>操作</th>
        </tr>
        {{each dataList as vo i}}
        <tr>
            <td class="text-center">{{if vo.status==1}}<span class="green">已上架</span>{{else}}<span class="red">未上架</span>{{/if}}</td>
            <td class="text-center">{{vo.goodsTypeName}}</td>
            <td>{{vo.goodsName}}</td>
            <td class="text-center"><img src="{{vo.goodsLogo}}" style="max-height:100px;max-width:100px;" /></td>
            <td style="text-align:center">￥<input class="form-control" name="{{'commonPrice'+vo.goodsId}}" style="width:30%;display:inline-block;text-align:center" value="{{vo.goodsCommonPrice/100}}">/{{vo.units}}</td>
            <td style="text-align:center">￥<input class="form-control" name="{{'memberPrice'+vo.goodsId}}" style="width:30%;display:inline-block;text-align:center" value="{{vo.goodsMemberPrice/100}}">/{{vo.units}}</td>
            <td class="text-center">
                <p class="xiajia hand blue" data-i="{{i}}">{{if vo.status==1}}下架{{else}}上架{{/if}}</p>
                <p class="edit hand blue" data-i="{{i}}">编辑</p>
                <span class="save hand blue" data-i="{{i}}">保存</span>
            </td>
        </tr>
        {{/each}}
    </table>


    {{if totalPage>1}}
    <nav class="text-right">
        <ul class="pagination">
            {{if pageNumber>1}}
            <li>
                <a href="{{pageNumber-1}}" aria-label="Previous">
                    <span aria-hidden="true">上一页</span>
                </a>
            </li>
            {{/if}}
            {{for var i = pageNumber-5; i < pageNumber + 5; i++}}
            {{if i>0 && i <= totalPage}}
            <li{{if i == pageNumber}} class="active"{{/if}}><a href="{{i}}">{{i}}</a></li>
            {{/if}}
            {{/for}}
            {{if pageNumber<totalPage}}
            <li>
                <a href="{{pageNumber+1}}" aria-label="Next">
                    <span aria-hidden="true">下一页</span>
                </a>
            </li>
            {{/if}}
        </ul>
    </nav>
    {{/if}}
</script>

    <!--积分商城部分模板-->
<script type="text/html" id="jifen_tmpl">
    <div class="tabright"><div class="btn gn_btn">新增积分商品</div></div>
    <table class="table table-bordered from_table">
        <tr>
            <th class="text-center" nowrap>状态</th>
            <th class="text-center" nowrap>名称</th>
            <th class="text-center" nowrap>图片</th>
            <th class="text-center" nowrap>积分</th>
            <th class="text-center" nowrap>操作</th>
        </tr>
        {{each dataList as vo i}}
        <tr>
            <td class="text-center">{{if vo.status==1}}<span class="green">已上架</span>{{else}}<span class="red">未上架</span>{{/if}}</td>
            <td>{{vo.goodsName}}</td>
            <td class="text-center"><img src="{{vo.goodsLogo}}" style="max-height:100px;max-width:100px;" /></td>
            <td class="text-center">{{vo.score}}</td>
            <td class="text-center">
                <p class="xiajia hand blue" data-i="{{i}}">{{if vo.status==1}}下架{{else}}上架{{/if}}</p>
                <span class="edit hand blue" data-i="{{i}}">编辑</span>
            </td>
        </tr>
        {{/each}}
    </table>
    {{if totalPage>1}}
    <nav class="text-right">
        <ul class="pagination">
            {{if pageNumber>1}}
            <li>
                <a href="{{pageNumber-1}}" aria-label="Previous">
                    <span aria-hidden="true">上一页</span>
                </a>
            </li>
            {{/if}}
            {{for var i = pageNumber-5; i < pageNumber + 5; i++}}
            {{if i>0 && i <= totalPage}}
            <li{{if i == pageNumber}} class="active"{{/if}}><a href="{{i}}">{{i}}</a></li>
            {{/if}}
            {{/for}}
            {{if pageNumber<totalPage}}
            <li>
                <a href="{{pageNumber+1}}" aria-label="Next">
                    <span aria-hidden="true">下一页</span>
                </a>
            </li>
            {{/if}}
        </ul>
    </nav>
    {{/if}}
</script>

    <!--管理分类部分模板-->
<script type="text/html" id="goodstype_tmpl">
    <div class="tabright"><div class="btn gn_btn">新增分类</div></div>
    <table class="table table-bordered from_table">
        <tr>
            <th class="text-center" nowrap>排序</th>
            <th class="text-center" nowrap>分类</th>
            <th class="text-center" nowrap>操作</th>
        </tr>
        {{each dataList as vo i}}
        <tr>
            <td class="text-center">{{vo.sort}}</td>
            <td class="text-center">{{vo.goodsTypeName}}</td>
            <td class="text-center">
                <span class="edit hand blue" data-i="{{i}}">编辑</span>
                <span class="del hand red" data-i="{{i}}">删除</span>
            </td>
        </tr>
        {{/each}}
    </table>
    {{if totalPage>1}}
    <nav class="text-right">
        <ul class="pagination">
            {{if pageNumber>1}}
            <li>
                <a href="{{pageNumber-1}}" aria-label="Previous">
                    <span aria-hidden="true">上一页</span>
                </a>
            </li>
            {{/if}}
            {{for var i = pageNumber-5; i < pageNumber + 5; i++}}
            {{if i>0 && i <= totalPage}}
            <li{{if i == pageNumber}} class="active"{{/if}}><a href="{{i}}">{{i}}</a></li>
            {{/if}}
            {{/for}}
            {{if pageNumber<totalPage}}
            <li>
                <a href="{{pageNumber+1}}" aria-label="Next">
                    <span aria-hidden="true">下一页</span>
                </a>
            </li>
            {{/if}}
        </ul>
    </nav>
    {{/if}}
</script>

    <!--编辑商品分类部分模板-->
<script type="text/html" id="goodstype_edit_tmpl">
    <table class="table table-striped table-bordered from_table" style="width:450px;">
        <tr>
            <td class="input_title required" width="160">分类名称</td>
            <td>
                <input type="hidden" value="{{id}}" name="id" />
                <input required errmsg="请输入分类名称" type="text" class="form-control" placeholder="请输入分类名称" name="goodsTypeName" value="{{goodsTypeName}}">
                <input type="hidden" value="{{shopId}}" name="shopId">
            </td>
        </tr>
        <tr>
            <td class="input_title required" width="160">分类排序</td>
            <td>
                <input required errmsg="请输入分类排序" type="tel" min="0" class="form-control" placeholder="请输入分类排序" name="sort" value="{{sort}}">
            </td>
        </tr>
        <tr>
            <td class="input_title required" width="160">是否打折</td>
            <td>
                <p>
                    <label for="discountStatus_true">打折</label>
                    <input required type="radio" id="discountStatus_true"  class="checkbox" name="discountStatus"
                           value="true" {{if discountStatus==true}}  checked="checked"{{/if}}>
                </p>
                <p>
                    <label for="discountStatus_false">不打折</label>
                    <input required type="radio" id="discountStatus_false"  class="checkbox" name="discountStatus"
                           value="false" {{if discountStatus!=true}}  checked="checked"{{/if}}>
                </p>
            </td>
        </tr>
        <tr id="discountLimit_tr">
            <td class="input_title required" width="160">打折额度</td>
            <td width="350">
                <div id="discountLimitList_div" style="width: 90%;display: inline-block">
                    {{if discountLimit.length > 0}}
                        {{for var i=0;i<discountLimit.length;i++}}
                            <div name="discountLimit_div" style="width: 80px;display: inline-block">
                                <input class="form-control discountLimit-input" name="discountLimit" value="{{discountLimit[i]}}">
                                <span class="glyphicon glyphicon-minus"></span>
                            </div>
                        {{/for}}
                    {{/if}}
                </div>
                <span class="glyphicon glyphicon-plus"></span>
            </td>
        </tr>
    </table>
</script>

<!--订单额度-->
<script type="text/html" id="discountLimitList_div_tmpl">
    <div name="discountLimit_div" style="width: 80px;display: inline-block">
        <input class="form-control discountLimit-input" name="discountLimit">
        <span class="glyphicon glyphicon-minus"></span>
    </div>
</script>

    <!--编辑商品部分模板-->
<script type="text/html" id="goods_edit_tmpl">
    <table class="table table-striped table-bordered from_table">
        <tr>
            <td class="input_title required" width="140">商品名称</td>
            <td>
                <input type="hidden" value="{{id}}" name="id" />
                <input required errmsg="请输入商品名称" type="text" class="form-control" placeholder="请输入商品名称" name="goodsName" value="{{goodsName}}">
            </td>
        </tr>
        <tr>
            <td class="input_title required" width="140">商品描述</td>
            <td>
                <input required errmsg="请输入商品描述" type="text" min="0" class="form-control" placeholder="请输入商品描述" name="goodsDescript" value="{{goodsDescript}}">
            </td>
        </tr>
        <tr>
            <td class="input_title required" width="140">商品分类</td>
            <td>
                <select name="goodsTypeId" class="form-control" required errmsg="请选择商品分类">
                    <option value="">请选择商品分类</option>
                    {{each lists as vo i}}
                    <option value="{{vo.id}}"{{if vo.id==goodsTypeId}} selected{{/if}}>{{vo.goodsTypeName}}</option>
                    {{/each}}
                </select>
            </td>
        </tr>
        <tr>
            <td class="input_title required" width="140">商品排序</td>
            <td>
                <input required errmsg="请输入商品排序" type="tel" min="0" class="form-control" placeholder="请输入商品排序" name="sort" value="{{sort}}">
            </td>
        </tr>
        <tr>
            <td class="input_title required" width="140">商品图片</td>
            <td id="yulantu" style="padding:0;"></td>
        </tr>
        <tr>
            <td class="input_title required" width="140">售价</td>
            <td>
                <input required errmsg="请输入售价" type="number" min="0" class="form-control" placeholder="请输入售价" name="goodsCommonPrice" value="{{goodsCommonPrice/100}}">
            </td>
        </tr>
        <tr>
            <td class="input_title" width="140">会员价</td>
            <td>
                <input type="number" min="0" class="form-control" placeholder="选填（折扣价）" name="goodsMemberPrice" value="{{goodsMemberPrice/100}}">
            </td>
        </tr>
        <tr>
            <td class="input_title required" width="140">所属分店</td>
            <td>
                {{each shopList as vo i}}
                <label><input  type="checkbox" class="checkbox" name="shopId" value="{{vo.shopId}}" /> {{vo.shopName}}</label>
                {{/each}}
            </td>
        </tr>
        <tr>
            <td class="input_title" width="140">打印区域</td>
            <td>
                {{each printList as vo i}}
                <label><input type="checkbox" class="checkbox" name="print" value="{{vo.id}}" /> {{vo.place}}</label>
                {{/each}}
            </td>
        </tr>
        <tr>
            <td class="input_title" width="140">单位</td>
            <td>
                <label><input type="radio" class="checkbox" name="units" value="份" />份</label>
                <label><input type="radio" class="checkbox" name="units" value="瓶" />瓶</label>
                <label><input type="radio" class="checkbox" name="units" value="个" />个</label>
                <label><input type="radio" class="checkbox" name="units" value="只" />只</label>
                <label><input type="radio" class="checkbox" name="units" value="盒" />盒</label>
                <label><input type="radio" class="checkbox" name="units" value="听" />听</label>
                <label><input type="radio" class="checkbox" name="units" value="串" />串</label>
                <label><input type="radio" class="checkbox" name="units" value="斤" />斤</label>
            </td>
        </tr>
         <tr>
            <td class="input_title required" width="140">可否回库</td>
            <td>
                <label><input class="checkbox" required errmsg="请选择商品类型" type="radio" name="disposable" value="0" {{if disposable==0}}checked="checked"{{/if}}/> 可以</label>
                <label><input class="checkbox" required errmsg="请选择商品类型" type="radio" name="disposable" value="1" {{if disposable==1}}checked="checked"{{/if}}/> 不可以</label>
            </td>
        </tr>
        <!--&lt;!&ndash;<tr id="jftr"{{if !type}}style="display:none"{{/if}}>
            <td class="input_title" width="140">所需积分</td>
            <td>
                <input type="number" min="0" class="form-control" placeholder="选填（折扣价）" name="" value="">
            </td>
        </tr> -->
    </table>
    <p class="red" style="text-indent:2em;margin:16px 0">注：“*”部分为必填，请认真填写。</p>
    <div class="text-center">
        <button type="button" class="btn gn_btn blue_btn from_submit">保存提交</button>
    </div>
</script>

    <!--编辑积分商品部分模板-->
<script type="text/html" id="jifen_edit_tmpl">
    <table class="table table-striped table-bordered from_table">
        <tr>
            <td class="input_title required" width="140">商品名称</td>
            <td>
                <input type="hidden" value="{{id}}" name="id" />
                <input required errmsg="请输入商品名称" type="text" class="form-control" placeholder="请输入商品名称" name="goodsName" value="{{goodsName}}">
            </td>
        </tr>
        <tr>
            <td class="input_title required" width="140">商品描述</td>
            <td>
                <input required errmsg="请输入商品描述" type="text" min="0" class="form-control" placeholder="请输入商品描述" name="goodsDescript" value="{{goodsDescript}}">
            </td>
        </tr>
        <tr>
            <td class="input_title required" width="140">商品排序</td>
            <td>
                <input required errmsg="请输入商品排序" type="tel" min="0" class="form-control" placeholder="请输入商品排序" name="sort" value="{{sort}}">
            </td>
        </tr>
        <tr>
            <td class="input_title required" width="140">商品图片</td>
            <td id="yulantu" style="padding:0;"></td>
        </tr>
        <tr>
            <td class="input_title required" width="140">所需积分</td>
            <td>
                <input required errmsg="请输入所需积分" type="number" min="0" class="form-control" placeholder="请输入所需积分" name="score" value="{{score}}">
            </td>
        </tr>
        <tr>
            <td class="input_title required" width="140">所属分店</td>
            <td>
                {{each shopList as vo i}}
                <label><input required type="checkbox" class="checkbox" name="shopId" value="{{vo.shopId}}" /> {{vo.shopName}}</label>
                {{/each}}
            </td>
        </tr>
        <tr>
            <td class="input_title" width="140">打印区域</td>
            <td>
                {{each printList as vo i}}
                    <label><input type="checkbox" class="checkbox" name="print" value="{{vo.id}}" /> {{vo.place}}</label>
                {{/each}}
            </td>
        </tr>
        <tr>
            <td class="input_title" width="140">单位</td>
            <td>
                <label><input type="radio" class="checkbox" name="units" value="份"/>份</label>
                <label><input type="radio" class="checkbox" name="units" value="斤"/>斤</label>
            </td>
        </tr>
    </table>
    <p class="red" style="text-indent:2em;margin:16px 0">注：“*”部分为必填，请认真填写。</p>
    <div class="text-center">
        <button type="button" class="btn gn_btn blue_btn from_submit">保存提交</button>
    </div>
</script>

    <!--图片显示部分模板-->
<script type="text/html" id="ylt_tmpl">
    {{if url}}
    <div class="grid" style="margin:20px;">
        <div style="margin-right:20px;">
            <img src="{{url}}" width="256" />
            <input type="hidden" value="{{url}}" name="goodsLogo" required errmsg="请上传预览图" />
        </div>
        <div id="picker"></div>
    </div>
    {{else}}
    <div class="grid">
        <div style="padding:15px 20px;font-size:14px;" class="gray g-col">
            <input type="hidden" name="goodsLogo" required errmsg="请上传预览图" />
            请将预览图的图片上传至此处
        </div>
        <div id="picker"></div>
    </div>
    {{/if}}
</script>


<script src="http://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

<script src="/public/store/webuploader.js"></script>



































